<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page isELIgnored="false"%>
<%@ include file="../common/taglibs.jsp"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>

<title>操作员查询</title>

<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">

	<link href="<s:url value="/css/common.css"/>" type="text/css"

	rel="stylesheet" />
<script type="text/javascript"
	src="<c:url value="/js/jquery-1.3.2.js" />"></script>
<script type="text/javascript" src="<c:url value="/js/common.js" />"></script>
<script language="javascript" type="text/javascript"
	src="<c:url value="/js/My97DatePicker/WdatePicker.js"/>"></script>
	<script type="text/javascript" src="/js/jquery-1.9.1.js"></script>
<script type="text/javascript" src="/js/tabcontrol/TabPanel.js"></script>

<script type="text/javascript">

	$(document).ready(function() {
	    $("#sub").click(function(){ 
		    $("#queryForm").attr("action","<%=basePath%>/model/queryProfitModuleList.ct");
			$("#queryForm").submit();
	     });
	    
		$("#btnAdd").click(function(){
				$("#queryForm").attr("action","${rootPath}/model/addProfitModule.ct");
			    return true; 
			});
	});

	function modifProfitModule(id){
		$("#queryForm").attr("action","${rootPath}/model/modifProfitModule.ct?modelId=" + id);
		$("#queryForm").submit();
	}
	function delProfitModule(id){
		
		if(!window.confirm("您确定要删除吗？")){
		  return;
		}
		$("#queryForm").attr("action","${rootPath}/model/delProfitModule.ct?modelId=" + id);
		$("#queryForm").submit();
	}

	function setDefaultModule(id){
		$("#queryForm").attr("action","${rootPath}/model/setDefaultProfitModule.ct?modelId=" + id );
		$("#queryForm").submit();
	}
</script>



</head>

<body>
	<div class="subpage">
		<s:form id="queryForm" action="/model/queryProfitModuleList.ct" method="post" theme="simple">
			
		<table class="tb">
		    <tbody>
		        <tr class="tb-line">
		            <td class="tb-td" colspan="4"><div class="tb-h2">POS收单运营管理平台</div></td>
		        </tr>
		        <tr class="tb-line">
		            <td class="tb-td" colspan="4"><div class="tb-h3">代理商分润模板</div></td>
		        </tr>
		        <tr class="tb-line">
		            <td width="12%" style="min-width: 150px" align="right" class="tb-td">
		                <div class="tb-h4">模板名称：</div>
		            </td>
		            <td class="tb-td" colspan="3">
		                <label class="tb-input-lengthen" style="width: 100%;height:36px;display: inline-table;">
		                	<s:textfield id="modelName" name="searchCondition.modelName" cssClass="fullWidth" />
		                </label>
		            </td>
		        </tr>
				
		        <tr class="tb-line">
		            <td class="tb-td line-submit" align="right" colspan="4">
		                <label class="tb-input-submit">
							<input id="sub" value="查   询" type="button"/>
		                </label>
		                <label class="tb-input-submit">
		                    <s:reset value="取 消" />
		                </label><br/>
		                <label class="tb-input-submit">
		                   <s:submit id="btnAdd" value="新增分润模板" />
		                </label>
		            </td>
		        </tr>
		    </tbody>
		</table>
			
			
				
		<div class="big-tb">
		    <table class="tb" style="width: 100%;">
		        <thead>
		        <tr class="tb-line">
						<td  class="tb-td line-submit"align="right" colspan="6" ><span style="font-color: red"><s:actionerror /></span>
							<span style="font-color: red;"><s:actionmessage /></span > <span style="font-color: red;"><s:fielderror
									cssClass="fieldError" /></span>
							<span id="otherError"></span>
						</td>
					</tr>
				<tr>
		            <tr class="tb-line">
		                <th class="tb-th" colspan="12">分润模板基本信息列表</th>
		            </tr>
		            <s:if
					test="#request.searchRsList != null && #request.searchRsList.size>0">
					<tr class="tb-line">
						<td class="tb-td paging" align="left" colspan="12"><page:pageCount
								max_pages="11" totalPage="${requestScope.totalPage}"
								currentPage="${requestScope.currentPage}"
								action="${rootPath}/model/queryProfitModuleList.ct?currentPage=" />

						</td>
					</tr>
					</s:if>
		            <tr class="tb-line bg-gray">
		                <th class="tb-th">模板名称</th>
		                <th class="tb-th">是否为默认模板</th>
		                <th class="tb-th">备注</th>
		                <th class="tb-th">创建日期</th>
		                <th class="tb-th">操作</th>
		            </tr>
		        </thead>
		        <tbody>
					<s:iterator value="#request.searchRsList" status="stat" id="model">
							<tr class="tb-line" >
								<td class="tb-td" align="center">  
									  <a href="javascript:modifProfitModule('<s:property value="#model.id"/>')"><s:property value="#model.moduleName"/></a>
								
								</td>
								<td class="tb-td" align="center">
									<s:if test="#model.status==0">
										否
									</s:if>
									<s:elseif test="#model.status==1">
										是
									</s:elseif>
								</td>
								<td class="tb-td" align="center">  <s:property value="#model.remark"/></td>
								<td class="tb-td" align="center">  <s:property value="#model.dtCreateStr"/></td>
								<td class="tb-td" align="center">
									  <a href="javascript:delProfitModule('<s:property value="#model.id"/>')">删除</a>
									<s:if test="#model.status!='' && #model.status==0">
									  <a href="javascript:setDefaultModule('<s:property value="#model.id"/>')">设置为默认模板</a>
									</s:if>
								</td>
							</tr>
						</s:iterator>
		        </tbody>
		    </table>
		</div>
		
		</s:form>
	</div>
</body>
</html>
